//package mytomcat;
//
//import mytomcat.entity.TBlog;
//import mytomcat.mapper.TBlogMapper;
//import mytomcat.util.MyBatisUtil;
//import org.apache.ibatis.datasource.pooled.PooledDataSourceFactory;
//import org.apache.ibatis.io.Resources;
//import org.apache.ibatis.mapping.Environment;
//import org.apache.ibatis.session.Configuration;
//import org.apache.ibatis.session.SqlSession;
//import org.apache.ibatis.session.SqlSessionFactory;
//import java.util.List;
//import java.util.UUID;
//
///**
// * @author swc
// * @date 2020/6/2 0002 下午 14:09
// */
//public class TestMyBatis {
//
//    public static void main(String[] args) throws Exception{
//        SqlSessionFactory sqlSessionFactory =null;
//        try {
//            sqlSessionFactory = MyBatisUtil.getSqlSessionFactory(null);
//            SqlSession sqlSession =  sqlSessionFactory.openSession();
//            TBlogMapper mapper = sqlSession.getMapper(TBlogMapper.class);
//
//            TBlog tBlog =new TBlog();
//            tBlog.setContent(UUID.randomUUID().toString());
//            tBlog.setTitle("内容是随机的"+System.currentTimeMillis());
//
//            mapper.add(tBlog);
//
//            List<TBlog> tBlogs = mapper.selectList();
//
//            System.out.println(sqlSessionFactory);
//
//        }catch (Exception ex){
//            ex.printStackTrace();
//        }
//
//    }
//}
